Rain water is almost pure. Being a good solvent,when it flows on the surface of the earth,it dissolves many salts.
Presence of calcium and magnesium salts in the form of hydrogencarbonate,chloride,and sulphate in water makes water 'hard'.
Hard water does not give lather with soap. Water free from soluble salts of calcium and magnesium is called 'soft' water. It gives lather with soap easily.
Hard water forms scum/precipitate with soap. Soap containing sodium stearate $(C_{17}H_{35}COONa)$ reacts with hard water to precipitate out $Ca^{2+}$ or $Mg^{2+}$ stearate.
$2 C_{17}H_{35}COONa_{(aq)} + M^{2+}_{(aq)} \longrightarrow (C_{17}H_{35}COO)_{2} M_{(s)} \downarrow + 2 Na^{+}_{(aq)}$
Here,$M$ represents $Ca^{2+}$ or $Mg^{2+}$.
It is,therefore,unsuitable for laundry. It is also harmful for boilers because of the deposition of salts in the form of scale,which reduces the efficiency of the boiler. The hardness of water is of two types: $(i)$ temporary hardness,and $(ii)$ permanent hardness.